﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ESRI.ArcGIS.Client.Toolkit">
    <Style TargetType="local:FeatureDataForm">
        <Setter Property="TextBoxStyle">
            <Setter.Value>
                <Style TargetType="{x:Type TextBox}">
                    <Style.Triggers>
                        <Trigger Property="Validation.HasError" Value="true">
                            <Setter Property="ToolTip" 
                        Value="{Binding RelativeSource={RelativeSource Self}, 
                        Path=(Validation.Errors)[0].ErrorContent}" />
                        </Trigger>
                    </Style.Triggers>
                </Style>                
            </Setter.Value>
        </Setter>        
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFF3F7FA" Offset="0"/>
                    <GradientStop Color="#FFFFFFFF" Offset="0.1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FFA3AEB9" Offset="0"/>
                    <GradientStop Color="#FF8399A9" Offset="0.375"/>
                    <GradientStop Color="#FF718597" Offset="0.375"/>
                    <GradientStop Color="#FF617584" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:FeatureDataForm">
                    <Border x:Name="DataFormBorder" Background="{TemplateBinding Background}" 
                            BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="2" 
                            BorderThickness="{TemplateBinding BorderThickness}">                        
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <ScrollViewer IsTabStop="False" 
                                          Background="{x:Null}" Padding="{TemplateBinding Padding}" 
                                          VerticalScrollBarVisibility="Auto">
                                <ContentPresenter x:Name="ContentPresenter" Margin="12,12,6,12"/>
                            </ScrollViewer>
                            <Grid Grid.Row="1" Margin="0,8,0,8">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Button x:Name="CommitButton" Content="{TemplateBinding CommitButtonContent}" Margin="0,0,12,0" 
                                        Style="{TemplateBinding CommitButtonStyle}" 
                                        MinWidth="75" MinHeight="22" Visibility="Collapsed" Grid.Column="1"
                                        HorizontalAlignment="Right" VerticalAlignment="Center" 
                                        HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
                                <Button x:Name="DeleteButton" Content="{TemplateBinding DeleteButtonContent}" Margin="0,0,12,0" 
                                        Style="{TemplateBinding DeleteButtonStyle}" 
                                        MinWidth="75" MinHeight="22" Visibility="Collapsed" Grid.Column="2"
                                        HorizontalAlignment="Right" VerticalAlignment="Center" IsEnabled="False"
                                        HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>